import request from "@/apps/admin/units/request";

import {HttpResultData} from "@/types/project";


/**
 * 获取数据表
 */
export const getTableListApi = (): Promise<HttpResultData<any>> => request(`/system-db/list`)


/**
 * 优化表
 * @param connection
 * @param table
 */
export const optimizeTableApi = (connection: string, table: string): Promise<HttpResultData<any>> => request(`/system-db/optimize`, {connection, table}, 'POST')


/**
 * 修复表
 * @param connection
 * @param table
 */
export const repairTableApi = (connection: string, table: string): Promise<HttpResultData<any>> => request(`/system-db/repair`, {connection, table}, 'POST')


/**
 * 获取数据字典
 */
export const exportDictionaryApi = (): Promise<HttpResultData<any>> => request(`/system-db/dictionary`)


